package com.commerce.order.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.commerce.common.entity.Payment;
import com.commerce.common.entity.PaymentMethod;

import java.util.List;
import java.util.Map;

/**
 * 支付服务接口
 */
public interface PaymentService extends IService<Payment> {

    /**
     * 获取启用的支付方式列表
     */
    List<PaymentMethod> getEnabledPaymentMethods();

    /**
     * 创建支付订单
     */
    Payment createPayment(Long orderId, Long paymentMethodId);

    /**
     * 执行支付
     */
    Map<String, Object> executePayment(String paymentNo, String paymentMethodCode);

    /**
     * 根据支付单号获取支付记录
     */
    Payment getPaymentByNo(String paymentNo);

    /**
     * 处理支付回调
     */
    boolean handlePaymentCallback(String paymentMethodCode, Map<String, Object> callbackData);

    /**
     * 取消支付
     */
    boolean cancelPayment(String paymentNo);

    /**
     * 更新支付状态
     */
    boolean updatePaymentStatus(String paymentNo, Integer status, String thirdPartyTradeNo);
}
